#include <iostream>

using std::cout;
using std::endl;

int
max(int a, int b)
{
    return a > b ? a : b;
}

int
main(int argc, char **argv)
{
    for (int row = 1; row <= 8; ++row)
    {
        int spaces = max(4 - row, row - 5);
        int hashes = 2 * (4 - spaces);

        for (int space = 0; space < spaces; ++space)
        {
            cout << " ";
        }

        for (int hash = 0; hash < hashes; ++hash)
        {
            cout << "#";
        }

        cout << "\n";
    }
}
